package com.iwinding.ladygg.net.callback;

import android.text.TextUtils;

import com.iwinding.ladygg.net.response.BaseRopnse;
import com.iwinding.ladygg.net.response.SendSOSRp;
import com.iwinding.ladygg.utils.GsonUtil;
import com.iwinding.ladygg.utils.LogUtil;

/**
 * Created by hezhiyong on 2017/3/24.
 */

public abstract class SendSOSCallback extends BaseRpCallback<SendSOSRp> {

    @Override
    public SendSOSRp parseResponse(BaseRopnse response, int id) {
        LogUtil.i("@hzy", "icane----SendSOS:" );
        if(!response.success || TextUtils.isEmpty(response.data)){
            onFail(response.errMsg);
            return null;
        }
        SendSOSRp rp = GsonUtil.getInstance().formJson(response.data, SendSOSRp.class);
        return rp;
    }
}
